﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Framework;

namespace SchemaMonitor
{
    public class CConfig : Framework.CConfigBase
    {
        public static string OnlyUseSchema { get { return ConfigOrWrite("OnlyUseSchema", CSchema.Facebook.NAME); } }
		private static string PhotosConnStr { get { return ConfigOrWrite("PhotosConnStr", "server=.;database=JewBookPhotos;Trusted_Connection=True;"); } }


		public static string ImagesFolder { get { return Config("ImagesFolder", "D:\\_dump_photos\\"); } }
		public static string XCorrFolder  { get { return Config("XCorrFolder",  ImagesFolder + "\\xcorr\\"); } }
        public static string ThumbsPath     { get { return Config("ThumbsPath", ImagesFolder + "thumbs.proto"); } }
		public static string ThumbsPath_Old { get { return ImagesFolder + "thumbs.proto.gz"; } }



        private static CDataSrc _photos;
		public static CDataSrc Photos
		{
			get
			{
				if (null == _photos)
					if (PhotosConnStr.Contains("server") && PhotosConnStr.Contains("database"))
						_photos = new CSqlClient(PhotosConnStr);
					else
						_photos = new CWebSrcBinary(PhotosConnStr);
				return _photos;
			}
			set
			{
				_photos = value;
			}
		}
	}
}
